home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / data / scripts / particle_system.lua < prev    next >
Encoding:
Text File  |  2006-02-27  |  3.8 KB  |  138 lines

  1. --
  2. -- particle system creation test
  3. --
  4. desc = getEffectDescriptionP(ENET_EFFECT_PS_TEST)
  5.  
  6. desc.ClassID = ENCLASS_SIMPLEPARTICLESYSTEM
  7. desc.EffectClassType = ENECT_PARTICLESYSTEM
  8.  
  9. desc.ScriptSet = ENSCRIPTSET_UNKNOWN
  10. desc.RelativePosition = ENLOCALPOS_NOTSPECIFIED
  11. local vzbzd1 = D3DXVECTOR3:new(0,0,0)
  12. desc.LocalPosition = vzbzd1
  13. vzbzd1:delete()
  14. desc.isAnimateTexture = false
  15. desc.RenderType = ENRENDERTYPE_GEOMETRY
  16.  
  17. Emitter = desc.PS.PSDescription
  18. Emitter.ParticleTypesNumber = 1
  19. local vzbzd2 = D3DXVECTOR3:new(0,0,0)
  20. Emitter.EmitterPosition = vzbzd2
  21. vzbzd2:delete()
  22. local vzbzd3 = D3DXVECTOR3:new(0,0,0)
  23. Emitter.EmitterDirection = vzbzd3
  24. vzbzd3:delete()
  25. Emitter.EmitterLifeTime = 10000
  26.  
  27. PT = Emitter.ParticleTypesParams[1]
  28. PT.IsEmitterLocked = true
  29. PT.DrawOrder = 1
  30. PT.Material = ENMAT_SIMPLEPARTICLE
  31.  
  32. PT.TextureName = "smoke.dds";
  33.  
  34. PT.ParticlesPerSecond = 100.0;
  35. PT.InitialNumberOfParticles = 0.0;
  36. PT.BaseLifeTime = 1.0;
  37. PT.BaseLifeTimeVariance = 0.4;
  38. PT.BaseSpeed = 100.0;
  39. PT.BaseSpeedVariance = 0.5;
  40. PT.BaseAngle = 1.0;
  41. PT.BaseAngleVariance = 0.8;
  42. PT.BaseAngleSpeed = 0.9;
  43. PT.BaseAngleSpeedVariance = 0.5;
  44. PT.BaseAngleSpeedDirection = 1;
  45. local vzbzd4 = D3DXVECTOR3:new(0.0,-0.7,-0.7)
  46. PT.BaseDirection = vzbzd4
  47. vzbzd4:delete()
  48. local vzbzd5 = D3DXVECTOR3:new(0.0,0.0,0.0)
  49. PT.BaseDirectionVariance = vzbzd5
  50. vzbzd5:delete()
  51. local vzbzd6 = D3DXVECTOR3:new(0,0,0)
  52. PT.BasePosition = vzbzd6
  53. vzbzd6:delete()
  54. local vzbzd7 = D3DXVECTOR3:new(10,10,10)
  55. PT.BasePositionVariance = vzbzd7
  56. vzbzd7:delete()
  57. PT.BaseSize = 8.0;
  58. PT.BaseSizeVariance = 0.2;
  59.  
  60. -- color over time
  61. PT.ColorOverTimeR[1].TimePercent = 0.0
  62. PT.ColorOverTimeR[1].Value = 0.0
  63. PT.ColorOverTimeG[1].TimePercent = 0.0
  64. PT.ColorOverTimeG[1].Value = 0.0
  65. PT.ColorOverTimeB[1].TimePercent = 0.0
  66. PT.ColorOverTimeB[1].Value = 0.0
  67.  
  68. PT.ColorOverTimeR[2].TimePercent = 0.5
  69. PT.ColorOverTimeR[2].Value = 0.2
  70. PT.ColorOverTimeG[2].TimePercent = 0.5
  71. PT.ColorOverTimeG[2].Value = 0.2
  72. PT.ColorOverTimeB[2].TimePercent = 0.5
  73. PT.ColorOverTimeB[2].Value = 0.2
  74.  
  75. PT.ColorOverTimeR[3].TimePercent = 1.0
  76. PT.ColorOverTimeR[3].Value = 1.0
  77. PT.ColorOverTimeG[3].TimePercent = 1.0
  78. PT.ColorOverTimeG[3].Value = 1.0
  79. PT.ColorOverTimeB[3].TimePercent = 1.0
  80. PT.ColorOverTimeB[3].Value = 1.0
  81.  
  82. -- transparency over time
  83. PT.TransparencyOverTime[1].TimePercent = 0.0;
  84. PT.TransparencyOverTime[1].Value = 0.0;
  85.  
  86. PT.TransparencyOverTime[2].TimePercent = 0.6;
  87. PT.TransparencyOverTime[2].Value = 0.3;
  88.  
  89. PT.TransparencyOverTime[3].TimePercent = 1.0;
  90. PT.TransparencyOverTime[3].Value = 0.0;
  91.  
  92. -- size over time
  93. PT.SizeOverTime[1].TimePercent = 0.0;
  94. PT.SizeOverTime[1].Value = 1.0;
  95.  
  96. PT.SizeOverTime[2].TimePercent = 0.7;
  97. PT.SizeOverTime[2].Value = 3.0;
  98.  
  99. PT.SizeOverTime[3].TimePercent = 1.0;
  100. PT.SizeOverTime[3].Value = 1.0;
  101.  
  102. -- Speed over time
  103. PT.SpeedOverTime[1].TimePercent = 0.0;
  104. PT.SpeedOverTime[1].Value = 1.0;
  105.  
  106. PT.SpeedOverTime[2].TimePercent = 1.0;
  107. PT.SpeedOverTime[2].Value = 0.2;
  108.  
  109. -- Tangent Speed over time
  110. PT.TangentSpeedOverTime[1].TimePercent = 0.0;
  111. PT.TangentSpeedOverTime[1].Value = 1.0;
  112.  
  113. PT.TangentSpeedOverTime[2].TimePercent = 1.0;
  114. PT.TangentSpeedOverTime[2].Value = 0.2;
  115.  
  116. -- GravityAcceleration over time
  117. PT.GravityAccelerationOverTime[1].TimePercent = 0.0;
  118. PT.GravityAccelerationOverTime[1].Value = 100.0;
  119.  
  120. PT.GravityAccelerationOverTime[2].TimePercent = 1.0;
  121. PT.GravityAccelerationOverTime[2].Value = 100.0;
  122.  
  123. -- AngleSpeed over time
  124. PT.AngleSpeedOverTime[1].TimePercent = 0.0;
  125. PT.AngleSpeedOverTime[1].Value = 1.0;
  126.  
  127. PT.AngleSpeedOverTime[2].TimePercent = 0.25;
  128. PT.AngleSpeedOverTime[2].Value = 0.0;
  129.  
  130. PT.AngleSpeedOverTime[3].TimePercent = 0.75;
  131. PT.AngleSpeedOverTime[3].Value = 1.0;
  132.  
  133. PT.AngleSpeedOverTime[4].TimePercent = 1.0;
  134. PT.AngleSpeedOverTime[4].Value = 3.0;
  135. --
  136. -- end particle system description
  137. --
  138.